<script>
    layui.use(['table','form'], function() {
        var table = layui.table,form = layui.form,$ = layui.jquery;
        delAll = function(){
			var checkStatus = table.checkStatus('ad'); //test即为参数id设定的值
            var ids = [];
			$(checkStatus.data).each(function (i, o) {
				ids.push(o.id);
			});
			if(ids.length == 0){
				layer.msg('请选择删除项！', {time: 1000, icon: 2});
				return;
			}
            layer.confirm('确定要删除选中的内容吗？', {icon: 3}, function(index) {
                layer.close(index);
                var loading = layer.load(1, {shade: [0.1, '#fff']});
                $.post("{{ $url }}", {_method:'DELETE','ids': ids}, function (res) {
                    layer.close(loading);
                    if (res.status == 1) {
                        layer.msg(res.msg,{time:1000,icon:1},function(){
							location.href = res.url;
						});
                    } else {
                        layer.msg(res.error, {time: 1000, icon: 2});
                    }
                });
            })
        };
    });
</script>